<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>swiper基本使用</title>
    <link rel="stylesheet" href="./css/swiper.min.css" />
    <style>
      .swiper-container {
        width: 600px;
        height: 300px;
      }
      .swiper-slide {
        text-align: center;
        line-height: 300px;
      }
    </style>
  </head>
  <body>
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <div class="swiper-slide">Slide 1</div>
        <div class="swiper-slide">Slide 2</div>
        <div class="swiper-slide">Slide 3</div>
        <div class="swiper-slide">Slide 4</div>
        <div class="swiper-slide">Slide 5</div>
        <div class="swiper-slide">Slide 6</div>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination"></div>

      <!-- 如果需要导航按钮 -->
      <div class="swiper-button-prev"></div>
      <div class="swiper-button-next"></div>
    </div>
    <script src="./js/swiper.min.js"></script>
    <script>
      // 在new swiper实例之前，页面中的结构必须得先有
      // 第一个参数：可以是字符串|真实的DOM节点
      var mySwiper = new Swiper('.swiper-container', {
        loop: true, // 循环模式选项

        // 如果需要分页器
        pagination: {
          el: '.swiper-pagination',
        },

        // 如果需要前进后退按钮
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev',
        },
      })
    </script>
  </body>
</html>

// 第一步：引包（相应JS|CSS） // 第二步：页面中结构必须要有 // 第三步：（页面当中必有结构）：new Swiper实例【轮播图添加动态效果】
